package edu.zhang.front.filter;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import edu.zhang.po.Customer;

@WebFilter(urlPatterns = {"/customer/*"})
public class FrontLoginFilter implements Filter {
	
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		/*
		 * HttpServletRequest httpServletRequest = (HttpServletRequest) request;
		 * HttpServletResponse httpServletResponse = (HttpServletResponse) response;
		 * HttpSession httpSession = httpServletRequest.getSession(); Customer customer
		 * = (Customer) httpSession.getAttribute("customer");
		 */
		/*
		 * if (customer == null) { httpServletResponse.sendRedirect("login.jsp"); } else
		 * { chain.doFilter(request, response); }
		 */
		chain.doFilter(request, response);
	}

}
